<template>
	<view class="box">
		<!-- 头部导航栏 -->
		<view class="header">
			<uv-icon name="arrow-leftward" bold="true" @click="back"></uv-icon>
			<div class="center">历史问诊</div>
			<view @click="gift">礼物</view>
		</view>

		<!-- 数据部分 -->
		<view class="main" v-for="(item,key) in getGoods" :key="key">
			<!-- <div class="left">
				<view class="photo">
					<image :src="item.image" mode=""></image>
				</view>
			</div> -->
			<div class="right">
				<div class="titTop">
					<view class="text">问诊人：&nbsp;&nbsp; {{item.username}}</view>
					<view class="text">邮箱：&nbsp;&nbsp; {{item.email}}</view>
				</div>
				<div class="lan">
					<button class="lan1" @click="Viewconsultation(item.id)">查看问诊记录</button>
					<button class="lan2" @click="Viewreviews(item.id)">查看评价</button>
				</div>
			</div>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				getGoods: []

			}
		},
		onLoad() {
			this.getList()
		},
		methods: {
			getList() {
				uni.request({
					url: 'http://172.27.6.151:32112/api/get/doctorList',
					method: 'GET',
					success: (res) => {
						console.log('历史问诊数据', res);
						this.getGoods = res.data.data
					}
				})
			},
			//跳转主页面
			back() {
				uni.reLaunch({
					url: '/pages/Index/Index'
				})
			},
			// 跳转我的礼物页面
			gift() {
				uni.reLaunch({
					url: "/pages/MyGift/MyGift"
				})

			},
			// 跳转问诊记录
			Viewconsultation(id) {
				uni.reLaunch({
					url: `/pages/ConsultationRecord/ConsultationRecord?id=${id}`
				})
			},
			// 跳转评价详情
			Viewreviews(id) {
				console.log(id);
				uni.reLaunch({
					url: `/pages/EvaluationDetails/EvaluationDetails?id=${id}`
				})
			}

		}
	}
</script>

<style>
	.header {
		width: 710rpx;
		margin-top: 85rpx;
		display: flex;
		justify-content: space-between;
		padding: 20rpx;
		border-bottom: 1rpx solid #ccc;
	}

	.titTop {
		width: 630rpx;
		padding-left: 80rpx;
	}

	.text {
		font-weight: 600;
		font-size: 30rpx
	}

	.main {
		width: 630rpx;
		height: 110px;
		border: 1px solid #ccc;
		margin-left: 38rpx;
		display: flex;
		margin-top: 60rpx;
		border-radius: 15rpx;
		padding: 20rpx;
	}

	.photo {
		width: 80px;
		height: 80px;

	}

	.photo image {
		width: 100%;
		height: 100%;
		border-radius: 50%;
	}

	/* .left {
		margin-top: 40rpx;
		margin-left: 20rpx;
	} */



	.lan {
		width: 630rpx;
		height: 60rpx;
		display: flex;
		justify-content: space-between;
		align-items: center;
		margin-top: 30rpx;
	}

	.lan1 {
		height: 70rpx;
		line-height: 70rpx;
		font-size: 30rpx;
		background-color: #55aaff;
		color: #fff;
		border-radius: 15rpx;
	}

	.lan2 {
		height: 70rpx;
		line-height: 70rpx;
		background-color: #55aaff;
		color: #fff;
		border-radius: 15rpx;
		margin-left: 20rpx;
	}
</style>